/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package enterprise.ent;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author JAVIER
 */
@Entity
@Table(name = "deportes_tipos_liga")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DeportesTiposLiga.findAll", query = "SELECT d FROM DeportesTiposLiga d"),
    @NamedQuery(name = "DeportesTiposLiga.findByIdDeporte", query = "SELECT d FROM DeportesTiposLiga d WHERE d.deportesTiposLigaPK.idDeporte = :idDeporte"),
    @NamedQuery(name = "DeportesTiposLiga.findByIdTipoLiga", query = "SELECT d FROM DeportesTiposLiga d WHERE d.deportesTiposLigaPK.idTipoLiga = :idTipoLiga")})
public class DeportesTiposLiga implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected DeportesTiposLigaPK deportesTiposLigaPK;

    public DeportesTiposLiga() {
    }

    public DeportesTiposLiga(DeportesTiposLigaPK deportesTiposLigaPK) {
        this.deportesTiposLigaPK = deportesTiposLigaPK;
    }

    public DeportesTiposLiga(int idDeporte, int idTipoLiga) {
        this.deportesTiposLigaPK = new DeportesTiposLigaPK(idDeporte, idTipoLiga);
    }

    public DeportesTiposLigaPK getDeportesTiposLigaPK() {
        return deportesTiposLigaPK;
    }

    public void setDeportesTiposLigaPK(DeportesTiposLigaPK deportesTiposLigaPK) {
        this.deportesTiposLigaPK = deportesTiposLigaPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (deportesTiposLigaPK != null ? deportesTiposLigaPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DeportesTiposLiga)) {
            return false;
        }
        DeportesTiposLiga other = (DeportesTiposLiga) object;
        if ((this.deportesTiposLigaPK == null && other.deportesTiposLigaPK != null) || (this.deportesTiposLigaPK != null && !this.deportesTiposLigaPK.equals(other.deportesTiposLigaPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "enterprise.ent.DeportesTiposLiga[ deportesTiposLigaPK=" + deportesTiposLigaPK + " ]";
    }
    
}
